package com.itheima.controller;

import com.itheima.entity.Result;
import com.itheima.pojo.ExceptionLog;
import com.itheima.pojo.SysLog;
import com.itheima.service.LogService;
import com.itheima.vo.ExceptionLogVo;
import com.itheima.vo.SysLogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Felix(李鑫)
 * @Date: 2020/9/1 16:17
 * @Description:  操作日志相关的接口
 */

@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    /**
     *  获取系统异常列表
     * @param exceptionLogVo
     * @return
     */
    @RequestMapping("/getExceptionList")
    public Result getExceptionList(ExceptionLogVo exceptionLogVo){
        List<ExceptionLog> list = logService.getExceptionList(exceptionLogVo);
        return new Result("success",list);
    }

    /**
     * 获取操作日志列表
     * @param sysLogVo
     * @return
     */
    @RequestMapping("/getLogList")
    public Result getLogList(SysLogVo sysLogVo){
        List<SysLog> list =  logService.getLogList(sysLogVo);
        return new Result("success",list);
    }
}
